package kos.robert.screens;

import java.awt.*;

import javax.swing.JFrame;

public class GameWindow extends JFrame {

	public static void main(String[] args) {
		DisplayMode dm = new DisplayMode(1440, 900, 32, DisplayMode.REFRESH_RATE_UNKNOWN);
		GameWindow gw = new GameWindow();
		gw.run(dm);
	}

	public void run(DisplayMode dm) {
		setBackground(Color.PINK);
		setForeground(Color.BLACK);
		setFont(new Font("Arial", Font.PLAIN, 24));

		Screen screen = new Screen();
		try {
			screen.setFullScreen(null, this);
			try {
				Thread.sleep(5000);
			} catch (Exception e) {
				// System.out.println("GameWindow has been interrupted\n");
			}
		} finally {
			screen.restoreScreen();
		}
	}

	public void paint(Graphics g) {
		if (g instanceof Graphics2D) {
			Graphics2D g2 = (Graphics2D) g;
			g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
		}
		g.drawString("Pozycja kursora jest nieznana", 20, 20);

	}
}